
#!/bin/sh
docker stop wt-web-site-t
PIDST=$!
wait $PIDST

docker rm wt-web-site-t
PIDA=$!
wait $PIDA

docker rmi wt-web-site:1.0.0
PIDS=$!
wait $PIDS


docker build -t wt-web-site:1.0.0 -f Dockerfile .

PID=$!

wait $PID

STATUS=$?

echo "命令的退出状态: $STATUS"
if [ $STATUS -eq 0 ]; then 
    
    docker run --name wt-web-site-t -p 3002:80 -it --rm -d wt-web-site:1.0.0

    PIDR=$!

    wait $PIDR
    echo "容器启动"
    

    # 获取容器的退出状态
else
    echo "命令执行失败"

fi
